Method for decreasing the dynamic range of a signal and electronic circuit

ABSTRACT

The invention relates to a method of decreasing the dynamic range of a signal comprising the steps of:—determining a property of the signal,—determining a limitation parameter based on the property of the signal,—limiting the signal by means of the limitation parameter,—clipping the limited signal.

FIELD OF THE INVENTION

The present invention relates to the field of dynamic range compression,and more particularly to dynamic range compression of audio signals.

BACKGROUND AND PRIOR ART

Dynamic range control (DRC) devices have been used for many years for avariety of purposes. One field of application of DRC devices inbroadcasting for the protection of transmitters against overload. Forthis purpose it is necessary to modify the dynamic range of thebroadcast signal because the channel has a defined peak limit at whichserver distortion on and overload can occur, and a lower limitdetermined by noise. Usually the dynamic range of the source materialcan be expected to be greater than that of the broadcast channel, andtherefore some kind of gain control must be used to maximize the servicearea without overloading the transmitter.

A limiter is one such device which has been developed for specificbroadcasting applications. It has also been used to prevent over-cuttingin the preparation of audio discs and to control levels beforeanalogue-to-digital conversion.

Another known device for dynamic range control is a compressor. Acompressor is used to effect larger change to the dynamic range by beingactive over a wider range of input signal levels. For example,compressors have been used to match the relatively wide dynamic range ofsound-program signals to the much narrower dynamic range of AM radiotransmissions. A compressor can also be used to smooth out thevariations in level caused than a vocalist moves towards an away fromthe microphone or to create special effects by altering the naturaldecay characteristic of an instrument such as a guitar.

A variety of digital methods for controlling the dynamic range ofdigitally coded audio signals is known from McNally, G. W., Dynamicrange control of digital audio signals. J. Audio Eng. Soc., 32, 316,1984.

In general conventional audio limiters can be characterized as beingeither the feedback type or the feed forward type. The feedback limiteris the more common type because its design is usually simpler and itprovides better peak level control without a need for precise control ofthe loop gain of the limiter circuit.

The feed forward limiter is more common in applications where a thinnedcompression ratio is desired.

Mapes-Riordan, D. and Leach, W M JR, The design of a digital signal peaklimiter for audio signal processing, J. Audio Eng. Soc., 36, 562, 1988provides an overview of various limited techniques.

U.S. Pat. No. 5,631,969 shows a method for limiting the magnitude of aninput signal where the input signal is sampled and transformed to obtainits component in-phase and quadrature components. The phasor magnitudeof the signal sample is determined from those in-phase and quadraturecomponents, and the input sample is limited based on the relationship ofthe phasor magnitude to a predetermined limit value. Specifically, thelimiting step includes scaling the sample input signal using a ratio ofthe predetermined threshold to the phasor magnitude.

U.S. Pat. No. 4,754,230 shows a clipping suppression circuit for acommunication system. The circuit includes a limiter peak detector forcausing the gain of an input amplifier to be reduced when a compressedoutput is driven toward a clipping output condition.

U.S. Pat. No. 5,579,404 shows a digital to audio limiter. A signalprocessing system receives a peak-amplitude limited input audio signal,generates a processed audio signal in response to the input audio signalsuch that peak-level increase may be present, estimates the peak-levelincrease of the full-bandwidth processed audio signal, and generates anoutput audio signal by applying to the portion of the full-bandwidthsubject to peak-level increase a gain factor adapted in response to theestimated peak amplitude.

U.S. Pat. No. 5,471,651 shows a system for compressing the dynamic rangof audio signals. An audio signal has its dynami9 c range compressed bya system which first samples a block of the audio signal, typicallyseveral seconds long. The level of the signal in this block is analyzedand an ideal signal level is calculated for the block. A gain controlsignal is then derived which adjusts the gain applied to that blocktowards that required to give the calculated ideal signal level.

In essence three different methods of decreasing the dynamic range ofprogram material have been used so far:

Compressors

Compressors, or dynamic-range compressors reduce the overall dynamicrange of any program material. For example, if the original programmaterial has a dynamic range of 90 dB, the dynamic range afterprocessing is reduces to 40 dB for FM broadcasting, or 20 dB for AMbroadcasting. The compressor consists of two elements: a level detectorand an amplifier with a variable gain. The detector could be a peakdetector or a root-mean-square detector including a certain temporalaverager. The topology of compressors is either feed-forward orfeed-backward. In the first case, the detected level of the leveldetector is converted to a gain value. The output signal then consistsof the input signal multiplied by the gain value. Usually, the gainbecomes smaller if the detected input level is larger. Consequently,high-level input signals are amplified less than low-level inputsignals, on the other hand, in feed-backward topologies the leveldetector is connected to the output of the compressor rather than theinput. The conversion from the detected level to resulting gaindescribes the amount of compression, while the time constant of thelevel detector determines the temporal behavior of the compressor. Morecomplex compressor designs include look-ahead features, variable attackand release times, soft-knee and hard-knee transitions and specificationof the dynamic range the compressor should work on.

Clippers

Clippers are relatively simple applications: if the amplitude of theprogram material is beyond a certain limit, the output is clipped to themaximum output value. Hard clippers have no transition range: theamplitude is either clipped or it is not. Soft clippers have a certaintransition range where the waveforms are non-linearly transformed insuch a way that no hard edges occur in the waveforms.

Limiters

Limiters scan for peaks in the audio signal and attenuate the audioportion around the peak if the attenuation is necessary to preventclipping. Associated with the attenuation curve are attack and releasetimes. The attack time is the time that the limiter takes to respond toa peak, while the release time is the time that the limiter needs torestore to the original signal level (i.e., no attenuation).

The disadvantage of a clipper is obvious: the clipping process oftencauses unacceptable distortion of the program material. Thedisadvantages of limiters and compressors are related to their temporalbehavior, in particular, the recovery or release time of these systemsis subject to several conflicting requirements. By making the recoverytime long compared to the time intervals between peaks in the signal,short transient peaks produce a prolonged gain reduction of the signal.This is heard as what is called a program “hole” or “dropout”. Inaddition, a long recovery time tends to decrease the power of thesignal, a recovery time that is too short will not only cause increasesignal distortion, especially for low-frequency in puts, but it alsocauses phenomena such as exaggeration of breath noises in speech,temporary reversal of the natural decay of sustained (piano) notes, afluttering effect caused by random fluctuations in gain, and thefluctuation of otherwise continuous parts of the program material. Thelatter effects are commonly called “gain pumping”, “breathing” and“swishing”. Attempts to remedy these problems have involved the use ofmore than one recovery time constant and making the time constantinversely proportional to frequency.

It is therefore an object of the present invention to provide for animproved method of decreasing the dynamic range of a signal as well as acorresponding electronic circuit and computer program product.

SUMMARY OF THE INVENTION

The invention provides for A method of decreasing the dynamic range of asignal comprising the steps of: determining a property of the signal,determining a limitation parameter (s) based on the property of thesignal, limiting the signal by means of the limitation parameter,clipping the limited signal.

Preferred embodiments of the invention are given in the dependentclaims.

Further the invention provides for an electronic circuit and a computerprogram for performing a method of the invention.

The present invention is particularly advantageous as it enables to clipa signal in a controlled manner, when the nature of the signal is suchthat clipping creates less orderable distortions in the program materialin comparison to conventional limiting.

It is important to note the prior art solutions of dynamic range controlfocus on attenuation of the signal to prevent clipping and the resultingdistortions. As a pose to this a point of departure of the presentinvention is the notion that for a specific class of signals, limitingresults in less audible distortion of the program material thanclipping, but for another class of signals, limiting results in morepronounced audible artifacts than clipping. For example, a pure sinusoidshould never be clipped because the clipping process results inpronounced distortion products. Fast limiting, on the other hand, hardlyresults in audible modulations in pure tones, as long as the releasetime of the limiter is longer than the period of the tone. For verytransient parts of the program material, such as onsets of percussioninstruments, limiting harms the temporal structures (natural decay) ofthe transient and causes gain pumping of non-transient elements of theprogram material, if such a transient would be clipped the distortionproducts caused by the clipping process are often not audible becausetransients usually have a broadband spectrum and hence distortionproducts are masked by the program material itself.

Of course, many signals are not part of these extreme signal classes. Todetermine to what extent a signal should be limited or clipped, the“local crest factor” is introduced. This measure is defined as the peakvalue of a certain time slice of the signal, divided by the rms-value ofthat time slice. For a pure sinusoid, the local crest factor amounts tothe square root of 2, while local peaks have much higher local crestfactors.

If the local crest factor is small (square root of 2) clipping should beavoided, while larger values of the local crest factor indicate thatmore clipping may be introduced.

Since most compressors/limiters already contain algorithms to find localpeaks and to compute the rms value of the certain time-slice of theaudio signal, this process can very easily be implemented in anyexisting audio limiter. Furthermore, the computational complexity isoverly simple.

In accordance with a preferred embodiment of the invention the propertyof the signal which determines the amount of limiting and clipping isdetermined by windowing the signal and determining the ratio of thesignal maximum and the signal RMS value within that window. The higherthis ratio is the more clipping is employed rather than limiting. Thishas the advantage that signal peaks are clipped rather than limitedwhich minimizes the orderable distortion of the signal as such peakshave a broadband spectrum and hence distortion products caused by theclipping amazed by the signal itself.

In accordance with a further preferred embodiment of the invention theratio of the signal maximum and the signal RMS value within the windowis compared to the threshold. Preferably the threshold is the squareroot of two which is the ratio obtained for a sinusoid input signal. Inthis case no clipping is used and the operation of the limiter is notinfluenced by the ratio.

The present invention is advantageously employed for a variety of audiopurposes:

Hearing Aids

In hearing aids, the signal which enters the hearing aid should beamplified as much as possible while keeping the occurrences of clippingminimal. Consequently, peaks in the audio signal limits the performanceof the hearing aid and can be reduced in accordance with presentinvention.

Audio Coding

In lossy audio coding applications, strong transients and peak signalscause difficulties in the coding process. In this class of applications,the spectral and temporal characteristics of the quantization noiseintroduced by the audio codec depend on the audio signal to be coded.However, the update rate at which the spectral properties of the noisechange is usually limited: the minimum audio frame length for whichcoding parameters are constant amounts to a few milliseconds.Consequently, coding of transients often results in pre-echos caused bythe fact that the quantization noise is already adapted to the hightransient level a few milliseconds before the actual transient. Toreduce the audibility of the pre-echos, a relatively large number ofbits have to be allocated to that specific audio frame. Because thenumber of bits determines the ratio between peak level of the signal andquantization noise, fewer bits have to be allocated if the peak isreduced in level in accordance with the present invention.

Record Industry

Especially popular music, the expression “louder is better” is becomingincreasingly important. CDs are labeled “hot” if the loudness of theprogram material is evenly so. Products that have been introduced thatincrease the loudness of musical contents without increasing the maximumamplitude value are the SPL Loudness Maximizer, the TC ElectronicsFinalizer and the Waves Ultramaximizer. This is another field ofapplication of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred embodiments of the invention are explained in the following ingreater detail by making reference to the drawings in which:

FIG. 1 is illustrative of a flow chart of an embodiment for performing amethod for decreasing the dynamic range of a signal,

FIG. 2 is a block diagram of a first embodiment of an electronic circuitin accordance with the invention,

FIG. 3 is a block diagram of an alternative embodiment.

DETAILED DESCRIPTION

The flow chart of FIG. 1 illustrates the decreasing of the dynamic rangeof a signal. In step 1 the input signal is windowed. This means that forprocessing of the signal at a given point of time the signal isconsidered during a time window.

In step 2 the so-called RMS value of the signal within the window isdetermined. The RMS value is the square root of the power of the signalwithin the window.

In step 3 the maximum amplitude of the signal within the window isdetermined. In step 4 the ratio of the signal maximum determined in step3 and the signal RMS value within the window as determined in step 2 iscalculated. Based on this ratio a signal attenuation is determined. Incase that the ratio or the so called “local crest factor” is relativelylarge; this means that the signal has a peak in the time window. Thehigher the peak in comparison to the rest of the signal within thewindow the higher the ratio. The ratio forms the bases to determine asignal attenuation as an input for the signal limitation. If the ratiois low no or little attenuation is selected. If the ratio is high ahigher attenuation factor is selected. The attenuation serves to controlthe limiter such that a signal with a large peak is not limited as muchas a signal with a lower peak as for a signal with a large peak clippingis more advantageous than limiting.

One way of controlling the limiter this way is to attenuate the signalmaximum and provide the attenuated signal maximum to the limiter as acontrol parameter. This is done in step 5.

In step 6 the scaling factor for the limitation is determined based onthe attenuated maximum as an input parameter.

In step 7 the original signal is limited by means of the scaling factor,i.e. by multiplying the actual signal value with the scaling factor. Incase that the signal maximums had been attenuated to provide acorresponding input parameter to the limiter based on which the scalingfactor is determined the output of the limiter may still exceed amaximum allowed signal level. This why the output of the limiter isclipped in step 8.

FIG. 2 shows a corresponding block diagram of an electronic circuit fordecreasing the dynamic range. The input signal to be processed isinputted in the form of a discrete time domain signal x [n], where x [n]is the sampled waveform of x [nT] and T is the sampling period. Forexample the sampling frequency f_(S) is 44.1 kH.

x [n] must be limited to b bits in the digital domain. Hence, themaximum amplitude value M to represent x [n] is given by M=2^(b-1). Thepurpose of the electronic circuit of FIG. 2 is to decrease the dynamicrange of the signal x [n] such that it does not surpass the maximumamplitude value of M.

The signal x [n] is inputted into the filter 10 for windowing the signalx [n]. For example the time window applied to the signal x [n] is chosenin the order of 50 milliseconds. The filter 10 outputs the set ofsamples of the signal x within the window length.

These samples are inputted into the filter 11 for determination of theRMS value of the signal within the window. The RMS value is calculatedby squaring and integrating the signal samples of the window in order tocalculate m_(RMS).

The set of samples which is outputted by the filter 10 is also inputtedinto the filter 12. The filter 12 serves to determine the maximum sampleof the signal x within the window. The maximum sample within the windowis denoted m₁.

The values m_(RMS) and m₁ are inputted into the processing unit 13 forcalculation of the ratio c which equals m₁ divided by m_(RMS). Thisratio c is also called the “crest factor” as it is indicative of aproperty of the signal related to the maximum of the signal within thewindow and the RMS value of the signal within the window.

The ratio c is inputted into the attenuation unit 14 as a controlparameter. Further the maximum m₁ is also inputted into the attenuation14. The maximum m₁ is attenuated by the attenuation unit 14 inproportion to the ratio c. This attenuation serves to control thelimiter 15 in order to decrease the amount of limiting performed by thelimiter 15 for signals having high peaks and thus a high ratio c.

The attenuated maximum m_(c) is outputted by the attenuation unit 14 andin putted into the limiter 15 as a control parameter. Based on theattenuated maximum m_(c) a scale factor s is determined by theprocessing unit 16 within limiter 15. For example the scale factor s ischosen such that the input signal x [n] does not surpass a predeterminedmaximum M within the time window assuming that the attenuated maximumm_(c) is the real maximum for the purposes of the limitation.

The input signal x [n] is inputted into the limiter 15 and multiplied bythe scale factor s. This creates the limited signal x′[n]. As theattenuated maximum m_(c) which serves as the basis for determining thescale factor s is not the real maximum but more or less below the realmaximum the limited signal x′[n] still has one or more peaks whichsurpass the maximum M. This is why a clipping operation is performed onthe limited signal x′[n] by means of the clipper 17. The clipper 17outputs the signal x″[n]. The signal x″[n] has a dynamic range whichdoes not surpass the maximum M.

To prevent clipping of signals which are closed a sinusoid it isadvantageous to compare the ratio c with a threshold of {square root}2.If the ratio is below the threshold the parameter c is chosen such thatno attenuation is performed in the attenuation unit 14.

FIG. 3 shows an alternative embodiment of the circuit of FIG. 2.Elements of the circuit of FIG. 3 which corresponds to elements of thecircuit of FIG. 2 are denoted by the same reference numerals.

In the circuit of FIG. 3 the filter 11 has a square unit 18 and anintegrator 19 for calculation of m_(RMS). The filter 12 has an unit 20for determining the maximum value of the signal samples within thewindow and a unit 21 to determine the sample with the maximum peak m₁.

The processing unit 13 has an unit 22 in accordance with the followingformula: $c = {{20\quad{\log\left( \frac{m_{i}}{m_{RMS}} \right)}} - 3}$

In the following unit 23 of the processing unit 13 the ratio m₁/m_(RMS)is compared with the threshold of {square root}2. If m₁/m_(RMS) is below{square root}2 c is set to be equal to zero. Otherwise c remainsunchanged. This thresholding operation ensures that no clipping isperformed for sinusoid signals.

The attenuation unit 14 has a multiplier 24 for multiplying the ratio cby a correction-strength factor k. The factor k determines the amount ofattenuation applied to the local maximum m₁ by the crest factor c. Fork=0 no correction is applied and the limiter 15 behaves like aconventional limiter. For larger values of k the local maximum m₁ isreduces by the value determined by k and the crest factor c whichapplied by means of multiplier 25. The attenuated maximum m_(c) is givenbym _(c) =m ₁10^(−kc/20)

A limiter 15 has an unit 26 for determining the maximum of theattenuated maximum m_(c) and the output of the unit 27. The output ofthe unit 26 is the maximum h which is inputted into the unit 27. Theoutput h is multiplied by exp(−1/f_(s)τ), with τ the release timeconstant of the limiter.

In other words the attenuated maximum m_(c) is compared with theprevious attenuated maximum multiplied by the exponential factor. Fromthese two numbers, the maximum is taken as the current maximum of thewaveform h. Hence, τ corresponds to the time constant that the limitercan release its attenuation.

The value of h is converted to the scale factor s within unit 28:$s = \left\{ \begin{matrix}1 & {{{if}\quad h} < M} \\{M/h} & {{{if}\quad h} \geq M}\end{matrix} \right.$where M is the maximum of the dynamic range.

The input signal x [n] is then multiplied by means of multiplier 29within limiter 15 to produce a limited output signal x [n]. This isinputted into the clipper 17 to produce the signal x″ [n].

It is to be noted that both k and c have non-negative values. Hence, theattenuated maximum m_(c) is smaller or equal to the actual maximum m₁.If the attenuated maximum m_(c) is indeed smaller than the smalleractual maximum m₁ the clipper 17 clips the signal. Since this onlyhappens for transients with a large bandwidth, distortion productsassociated with this clipping are not orderable.

Informal listening experiments demonstrated that an implementation witha value k of about 0.5 dB/dB, an analysis window length of 50 ms and arelease time τ of 0.5 seconds performs significantly more transparent(i.e., no audible distortion products and significantly less pumping andbreathing effects) than the conventional limiter (with k=0). Especiallywith critical source material (very peaky waveforms and program materialwith a deep bass content), the loudness and temporal behavior oftransients are preserves better.

List of Reference Numerals

-   filter 10-   filter 11-   filter 12-   processing unit 13-   attenuation unit 14-   limiter 15-   processing unit 16-   clipper 17-   square unit 18-   integrator 19-   unit 20-   unit 21-   unit 22-   unit 23-   multiplier 24-   multiplier 25-   unit 26-   unit 27-   unit 28-   multiplier 29

1. A method of decreasing the dynamic range of a signal comprising thesteps of: determining a property of the signal (c), determining alimitation parameter (s) based on the property of the signal, limitingthe signal by means of the limitation parameter, clipping the limitedsignal.
 2. The method of claim 1 further comprising the following stepsfor determining the property of the signal: windowing of the signal,determining of the ratio of the signal maximum within the window and thesignal RMS value within the window.
 3. The method of claim 2, whereby noclipping is performed when the ratio is below a predefined threshold. 4.The method of claim 2 further comprising: comparing the ratio to thethreshold, determining of the limitation parameter independently fromthe ratio if the ratio is below the threshold.
 5. The method of claim 3,whereby the threshold is substantially equal to or above the ratioobtained for a sinusoid signal.
 6. The method of claim 2, whereby theratio is modified by a correction factor (K) and the limitationparameter is determined based on the modified ratio.
 7. The method ofclaim 1 further comprising the following steps for determining thelimitation parameter based on the property: determining of the signalmaximum within the window, attenuation of the signal maximum inproportion to the ratio, filtering of the attenuated maximum,calculation of the limitation parameter by dividing the maximum (M) ofthe dynamic range by the filtered maximum, if the filtered maximum isabove the maximum of the dynamic range.
 8. An electronic circuitcomprising means for performing a method in accordance with claim
 1. 9.The electronic circuit of claim 8, whereby the electronic circuit is anaudio circuit.
 10. A computer program for performing a method inaccordance with claim 1.